Optimal. Leaf size=240 \[ \frac {a^2 \left (12+9 n+n^2\right ) \, _2F_1\left (1,-2+n;-1+n;\frac {1}{2} (1+\sec (c+d x))\right ) (a+a \sec (c+d x))^{-2+n}}{16 d (2-n)}+\frac {a^2 (3+n) \sec ^2(c+d x) (a+a \sec (c+d x))^{-2+n}}{4 d (1-n) (1-\sec (c+d x))^2}-\frac {a^2 \sec ^3(c+d x) (a+a \sec (c+d x))^{-2+n}}{d (1-n) (1-\sec (c+d x))^2}-\frac {a^2 (a+a \sec (c+d x))^{-2+n} \left (12+4 n-7 n^2-n^3-2 (1-n) (6+n) \sec (c+d x)\right )}{8 d \left (2-3 n+n^2\right ) (1-\sec (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 240, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3958, 102, 154,
151, 70} \begin {gather*} \frac {a^2 \left (n^2+9 n+12\right ) (a \sec (c+d x)+a)^{n-2} \, _2F_1\left (1,n-2;n-1;\frac {1}{2} (\sec (c+d x)+1)\right )}{16 d (2-n)}-\frac {a^2 \left (-2 (1-n) (n+6) \sec (c+d x)-n^3-7 n^2+4 n+12\right ) (a \sec (c+d x)+a)^{n-2}}{8 d \left (n^2-3 n+2\right ) (1-\sec (c+d x))}-\frac {a^2 \sec ^3(c+d x) (a \sec (c+d x)+a)^{n-2}}{d (1-n) (1-\sec (c+d x))^2}+\frac {a^2 (n+3) \sec ^2(c+d x) (a \sec (c+d x)+a)^{n-2}}{4 d (1-n) (1-\sec (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 70
Rule 102
Rule 151
Rule 154
Rule 3958
Rubi steps
\begin {align*} \int \csc ^5(c+d x) (a+a \sec (c+d x))^n \, dx &=-\frac {a^6 \text {Subst}\left (\int \frac {x^4 (a-a x)^{-3+n}}{(-a-a x)^3} \, dx,x,-\sec (c+d x)\right )}{d}\\ &=-\frac {a^2 \sec ^3(c+d x) (a+a \sec (c+d x))^{-2+n}}{d (1-n) (1-\sec (c+d x))^2}+\frac {a^4 \text {Subst}\left (\int \frac {x^2 (a-a x)^{-3+n} \left (3 a^2-a^2 n x\right )}{(-a-a x)^3} \, dx,x,-\sec (c+d x)\right )}{d (1-n)}\\ &=\frac {a^2 (3+n) \sec ^2(c+d x) (a+a \sec (c+d x))^{-2+n}}{4 d (1-n) (1-\sec (c+d x))^2}-\frac {a^2 \sec ^3(c+d x) (a+a \sec (c+d x))^{-2+n}}{d (1-n) (1-\sec (c+d x))^2}+\frac {a \text {Subst}\left (\int \frac {x (a-a x)^{-3+n} \left (-2 a^4 (3+n)-a^4 (1-n) (6+n) x\right )}{(-a-a x)^2} \, dx,x,-\sec (c+d x)\right )}{4 d (1-n)}\\ &=\frac {a^2 (3+n) \sec ^2(c+d x) (a+a \sec (c+d x))^{-2+n}}{4 d (1-n) (1-\sec (c+d x))^2}-\frac {a^2 \sec ^3(c+d x) (a+a \sec (c+d x))^{-2+n}}{d (1-n) (1-\sec (c+d x))^2}-\frac {a^2 (a+a \sec (c+d x))^{-2+n} \left (12+4 n-7 n^2-n^3-2 (1-n) (6+n) \sec (c+d x)\right )}{8 d \left (2-3 n+n^2\right ) (1-\sec (c+d x))}-\frac {\left (a^4 \left (12+9 n+n^2\right )\right ) \text {Subst}\left (\int \frac {(a-a x)^{-3+n}}{-a-a x} \, dx,x,-\sec (c+d x)\right )}{8 d}\\ &=\frac {a^2 \left (12+9 n+n^2\right ) \, _2F_1\left (1,-2+n;-1+n;\frac {1}{2} (1+\sec (c+d x))\right ) (a+a \sec (c+d x))^{-2+n}}{16 d (2-n)}+\frac {a^2 (3+n) \sec ^2(c+d x) (a+a \sec (c+d x))^{-2+n}}{4 d (1-n) (1-\sec (c+d x))^2}-\frac {a^2 \sec ^3(c+d x) (a+a \sec (c+d x))^{-2+n}}{d (1-n) (1-\sec (c+d x))^2}-\frac {a^2 (a+a \sec (c+d x))^{-2+n} \left (12+4 n-7 n^2-n^3-2 (1-n) (6+n) \sec (c+d x)\right )}{8 d \left (2-3 n+n^2\right ) (1-\sec (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(492\) vs. \(2(240)=480\).
time = 4.17, size = 492, normalized size = 2.05 \begin {gather*} -\frac {\cos (c+d x) (1+\sec (c+d x))^{-n} (a (1+\sec (c+d x)))^n \left (2^{1+n} \cot ^4\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) \left (\cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x)\right )^{-1+n}-3\ 2^n n \cot ^4\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) \left (\cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x)\right )^{-1+n}+2^n n^2 \cot ^4\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) \left (\cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x)\right )^{-1+n}-3\ 2^{2+n} (-2+n) \, _2F_1\left (1,1-n;2-n;\cos (c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right )\right ) \sec (c+d x) \left (\cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x)\right )^{-1+n}-2^n \left (-18+7 n+n^2\right ) \, _2F_1\left (2,1-n;2-n;\cos (c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right )\right ) \sec (c+d x) \left (\cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x)\right )^{-1+n}+32 \sec (c+d x) (1+\sec (c+d x))^n-12 n \sec (c+d x) (1+\sec (c+d x))^n-12 \sec ^2\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) (1+\sec (c+d x))^n+2 n \sec ^2\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) (1+\sec (c+d x))^n-2 \sec ^4\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) (1+\sec (c+d x))^n+2 n \sec ^4\left (\frac {1}{2} (c+d x)\right ) \sec (c+d x) (1+\sec (c+d x))^n\right )}{64 d (-2+n) (-1+n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.10, size = 0, normalized size = 0.00 \[\int \left (\csc ^{5}\left (d x +c \right )\right ) \left (a +a \sec \left (d x +c \right )\right )^{n}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\left (a+\frac {a}{\cos \left (c+d\,x\right )}\right )}^n}{{\sin \left (c+d\,x\right )}^5} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________